/*
 * @Descripttion: 
 * @version: 
 * @Author: qingzi
 * @Date: 2022-04-24 16:57:09
 * @LastEditors: qingzi
 * @LastEditTime: 2023-04-04 09:37:52
 */
import request from '@/utils/request';

/**
 *
 * @param params
 */
export function loginApi1(params: object) {
  return request({
    url: '/auth/security/login',
    method: 'post',
    data: params,
  });
}

/**
 *
 * @param params
 */

 interface loginType{
  password: string,
  username:string,
}

 export function loginApi(params: loginType) {
  return request({
    // url: '/auth/authUser/login',
    url: '/login',
    method: 'post',
    data: params,
  });
}

/**
 *
 * @param params
 * 注销
 */
 export function logout() {
  return request({
    // url: '/auth/authUser/logout',
    url: '/logout',
    method: 'post',
    // data: params,
  });
 }
/**
 *
 * @param params
 * 手机发送验证码
 */
 export function verfycode(phone:string) {
  return request({
    url: `/base/ums-center/auth/retrieve/phone_captcha/${phone}`,
    method: 'get',
  })
}

/**
 *
 * @param params
 * 找回密码-校验验证码
 */
 export function getverificationCode(queryParams:any) {
  return request({
    url: `/base/ums-center/auth/retrieve/verification_code`,
    method: 'get',
    params: queryParams
  })
}


/**
 *
 * @param params
 * 找回密码
 */
 export function searchPassword(params: object) {

  return request({
    url: '/base/ums-center/auth/updatePassword',
    method: 'post',
    data: params
  })
}

export function getCaptcha() {
  return request({
    url: '/base/ums-center/auth/verificationCode',
    method: 'get',
  })
}


/**
 *
 * @param params
 * 5.1.7获取登录用户的信息
 */
 export function userInfo() {
  return request({
    url: `/base/ums-center/auth`,
    method: 'get',
  });
}


/**
 *
 * @param params
 * 修改密码
 */
 export function updatePassword(params: object) {

  return request({
    url: '/base/ums-center/auth/changePassword',
    method: 'post',
    data: params,
  });
}
